import Vue from 'vue'
import VueRouter from "vue-router";
import login_box from "../components/login-box";
import register_box from "../components/register-box";
import logo_index from "../components/logo-index";
import Navigation_Admin from "../components/Navigation-Admin";
import Navigation_User from "../components/Navigation-User";
import Person from "../components/Person";
import Book_borrow from "../components/Book-borrow";
import Book_renew from "../components/Book-renew";
import Book_return from "../components/Book-return";
import User_admin from "../components/User-admin";
import Book_add from "../components/Book-add";
import Book_admin from "../components/Book-admin";
Vue.use(VueRouter);

export default new VueRouter({
  mode: 'history',
  routes:[
    {
      path: "/",
      redirect: '/logo'
    },
    {
      path: '/logo',
      name:"logo",
      component: logo_index,
    },
    {
      path: '/login-box',
      component: login_box,
    },
    {
      path: '/register-box',
      component: register_box,
    },
    // {
    //   path: "/user",
    //   redirect: '/user/person',
    // },
    {
      path: '/user',
      components: {
        Navigation_User:Navigation_User,
        default: Person,
      }
    },
    {
      path: '/borrow',
      components: {
        Navigation_User:Navigation_User,
        default: Book_borrow,
      }
    },
    {
      path: '/renew',
      components: {
        Navigation_User:Navigation_User,
        default: Book_renew,
      }
    },
    {
      path: '/return',
      components: {
        Navigation_User: Navigation_User,
        default: Book_return,
      }
    },
    {
      path: '/admin',
      components: {
        Navigation_Admin:Navigation_Admin,
        default: Person,
      }
    },
    {
      path: '/user-Admin',
      components: {
        Navigation_Admin:Navigation_Admin,
        default: User_admin,
      }
    },
    {
      path: '/book-add',
      components: {
        Navigation_Admin:Navigation_Admin,
        default: Book_add,
      }
    },
    {
      path: '/book-admin',
      components: {
        Navigation_Admin:Navigation_Admin,
        default: Book_admin,
      }
    },
  ]
});
